<template>
	<view>
		<view class="bottom_agree">
			<view class="agree_content">
				<u-checkbox class="checkboxBox" v-model="checked" label-size="26rpx" icon-size="18rpx" @change="handleChange">
					我已阅读并同意
					<text class="link" @click.native.stop="showAgreement('agreement')">《用户协议》</text>
					和
					<text class="link" @click.native.stop="showAgreement('privacy')">《隐私政策》</text>
				</u-checkbox>
			</view>
		</view>
	</view>
</template>

<script>
	import http from '@/utils/http'
	import api from '@/api'
	export default {
		name: "LoginAgree",
		data() {
			return {
				checked: false,
			};
		},
		created() {
			// const value = uni.getStorageSync('loginChecked');
			// if(value != ''){
			// 	this.checked = value ? value : false
			// 	uni.setStorageSync('loginChecked', this.checked);
			// }
		},
		methods: {
			showAgreement(alias) {
				uni.navigateTo({
					url:'/commonViews/Agree?alias=' + alias
				})
			},
			handleChange({value}){
				this.checked = value
				// uni.setStorageSync('loginChecked', value);
				this.$emit('handleChange',this.checked)
			}
		},
	}
</script>

<style lang="scss" scoped>
	.bottom_agree {
		margin: 0 auto 0;
		text-align: center;
		font-size: 20rpx;
		color: #999999;
		// width: fit-content;

		.agree_content {
			display: inline-block;
			text-align: center;
			margin-right:-32rpx;
			.link {
				color: #266DFF;
			}
		}
	}
</style>
<style>
	.u-checkbox__label{ 
		margin-right:0 !important;
	}
</style>